|
|
|
|
|
|
|
Listing 21.3. Coding the StartProc routine. |
|
|
|
|
|
|
|
|
Public Sub StartProc()
'
' start database
'
Set objRec = New recObject
'
objRec.DBName = strDBName
objRec.RSName = "SELECT * FROM secUsers ORDER BY UserID"
objRec.rsType = rsDynasetType
objRec.RSFocus = "UserID"
'
objRec.RSOpen Me
objRec.RSEnable Me, False
'
objRec.BtnBarAlign = bbBottom
objRec.BBInit Me
objRec.BBEnable Me, "11111111"
'
End Sub |
|
|
|
|
|
|
|
|
The code in Listing 21.3 initializes the record object, sets several properties, and then it's ready for you to begin. |
|
|
|
|
|
|
|
|
Add the code in Listing 21.4 to the cmdBtn_Click event. This code calls the BBProcess method of the record object library to handle all data entry functions. |
|
|
|
|
|
|
|
|
Listing 21.4. Coding the cmdBtn_Click event. |
|
|
|
|
|
|
|
|
Private Sub cmdBtn_Click(Index As Integer)
'
objRec.BBProcess Me, Index, "UserID"
'
' add default date/time for new recs
If Index = 0 And cmdBtn(0).Caption = "&Save" Then
txtField(3) = Now()
txtField(4) = Now()
End If
'
End Sub |
|
|
|
|
|
|
|
|
Next, add the code in Listing 21.5 to your project. This is the code that resizes the controls when the user resizes the form. |
|
|
|
|
|